#include<memory>
#include<string>
#include"Log.hpp"
#include"UdpServer.hpp"

void Usage(char *proc)
{
    std::cout<<"\nrUsage:"<<proc<<" port"<<std::endl;
}


std::string func(std::string cmd)
{
    int pid=fork();
    if(pid=0)
    {

    }
}

string Handler(string str)
{
    std::string message("Server#");
    message+=str;

    return message;
}

int main(int argc,char *argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(-1);
    }
    uint16_t port=std::stoi(argv[1]);
    std::unique_ptr<UdpServer>svr(new UdpServer(port));

    svr->Init();
    
    svr->Run(Handler);

    return 0;
}